﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace GoEasy
{
    class CommonFunction
    {
        private static ManualResetEvent allDone = new ManualResetEvent(false);
        private static HttpWebRequest request;
        public static void Request(string url,ref PlaceDetail placedetail)
        {
            WebClient webClient = new WebClient();
            webClient.DownloadStringAsync(new Uri(url));
            webClient.DownloadStringCompleted += webClient_DownloadStringCompleted;
        }
        public static void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(e.Result))
                {
                    //Parse JSON result as POCO 
                    var root1 = JsonConvert.DeserializeObject<object>(e.Result);
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
            }

        }
        
    }
}
